#!/bin/bash
# date: Mon Aug  1 13:39:13 CST 2022
# author: xkl

while  read -p "请输入数字(1代表打开防火墙,2代表关闭防火墙,3代表退出)" num
do
case $num in
	1)
		systemctl start firewalld.service
		echo -e "\e[32m已打开防火墙\e[0m"
		;;
	2)
		systemctl stop firewalld.service
		echo -e "\e[32m已关闭防火墙\e[0m"
		;;
	3)
		break;
		;;
	*)
		echo -e "\e[31m请按要求输入\e[0m"
		;;
esac
done;
